package org.afolsn.page

import grails.plugins.springsecurity.Secured
import org.springframework.orm.jpa.JpaCallback

class WelcomeController {

	def jpaTemplate
	
	@Secured(['IS_AUTHENTICATED_REMEMBERED'])
	def index = {
		render "Welcome to AFOL-SN"
	}
	
	def test = {
		jpaTemplate.execute( { entityManager ->
			def query = entityManager.createQuery("select from org.afolsn.user.User where login = 'marcin'")
			def result = query.resultList
			render result[0]
		} as JpaCallback )
	}
}
